package com.dp.ProxyPattern.DynamicProxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * Created by Lzz on 3/15/2018.
 */

public class GgDynamicProxy implements InvocationHandler{

    private Object mObject;

    public GgDynamicProxy(Object object) {
        mObject = object;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("------dynamic proxy previous-----");
        Object invoke = method.invoke(mObject, args);
        System.out.println("------dynamic proxy after-----");
        return invoke;
    }
}
